<%@ page import="java.util.List" %>
<%@ page import="com.entity.order" %>
<%@ page import="com.entity.orderdetails" %>
<%@ page import="com.entity.productdetails" %>
<%@ page import="com.dao.*" %>
<%@ page import="com.entity.product" %><%--
  Created by IntelliJ IDEA.
  User: 刘锦华
  Date: 2022/2/8
  Time: 17:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台</title>
    <link rel="stylesheet"  href="font-awesome-4.7.0/css/font-awesome.min.css"/>
    <!--导入第三方图片插件，目录里两个css，一个压缩版的一个没有压缩（压缩版是一行）-->
    <style>
        body{
            margin: 0;
        }
        .left{
            float: left;
        }
        .right{
            float: right;
        }
        .pg-header{
            height: 48px;
            background-color: #2459a2;
            color: white;
            line-height: 48px;
        }
        .pg-header .logo{
            width: 200px;
            background-color: #204982;
            text-align: center;
        }
        .pg-header .icons{
            padding: 0 20px;
        }
        .pg-header .icons:hover{
            background-color: #204982;
        }
        .pg-header .user{
            margin-right: 60px;
            padding: 0 20px;
            color: white;
            height: 48px;
            position: relative;
        }
        .pg-header .user:hover{
            background-color: #204982;
        }
        .pg-header .user .a img{
            height: 40px;width: 40px;margin-top: 4px;border-radius: 50%;
        }
        .pg-header .user .b{
            z-index: 20;
            position: absolute;
            /*相对于用户div定位*/
            top: 48px;
            right: 0;
            background-color: white;
            color: black;
            width: 160px;
            display: none;
            font-size: 14px;
            line-height: 30px;
        }
        .pg-header .user .b a{
            padding: 5px;
            color: black;
            text-decoration: none;
        }
        .pg-header .user .b a:hover{
            background-color: #dddddd;
        }
        .pg-header .user:hover .b{
            display: block;
        }
        .pg-header .user .b a{
            display: block;
        }
        .pg-content .menu{
            position: absolute;
            top:48px;
            left: 0;
            bottom: 0;
            width: 200px;
            background-color: #dddddd;
        }

        .pg-content .content{
            position: absolute;
            top: 48px;
            right: 0;
            bottom: 0;
            left: 200px;
            overflow: auto;
            z-index: 9;
        }
        /* 设置消息样式，数字外边加个圆圈 */
        .info {
            border-radius: 50%;
            line-height: 1px;
            background-color: red;
            padding: 10px 7px;
            font-size: 12px;
            display: inline-block;
        }
        .menus{
            margin-left: -50px;
        }
        .menus a{
            display: block;
            text-decoration: none;
            text-align: center;
            color: black;
            padding: 0 25px;
            font-size: 18px;
            line-height: 36px;
            border-left: 3px solid rgb(0, 0, 0);
            text-transform: uppercase;
        }
        .menus li:hover{
            background:#424242
        }
        .menus li:hover>a{
            color: white;
            border-left: 3px solid white;
        }
        .menus>li{

            float: left;
            position: relative;
        }
        table {
            width: 100%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/
        }
        th,td {
            height: 40px;
            line-height: 40px;
            text-align: center;
            border: 1px solid #ccc;
        }
        th {
            background: #eee;
            font-weight: normal;
        }
        tr {
            background: #fff;
        }
        tr:hover {
            background: #00B2FE;
        }
        td a {
            color: #06f;
            text-decoration: none;
        }
        td a:hover {
            color: #06f;
            text-decoration: underline;
        }
        div.search {padding: 10px 0;}
        .bar2 input {
            border: 2px solid #7BA7AB;
            border-radius: 5px;
            background: #F9F0DA;
            color: #9E9C9C;
        }
        .bar2 button {
            top: 0;
            right: 0;
            background: #7BA7AB;
            border-radius: 0 5px 5px 0;
        }
        .bar2 button:before {
            font-family: FontAwesome;
            font-size: 16px;
            color: #F9F0DA;
        }

        form {
            position: relative;
            width: 300px;
            margin: 0 auto;
        }

        input, button {
            border: none;
            outline: none;
        }

        input {
            width: 100%;
            height: 42px;
            padding-left: 13px;
        }

        button {
            height: 47px;
            width: 42px;
            cursor: pointer;
            position: absolute;
            left: 275px;
        }
    </style>
    <script>
        var s=<%=request.getSession().getAttribute("shen")%>
        if(s===yes)
        {
            alert("审核成功")
        }
    </script>
</head>
<body>

<div class="pg-header">
    <div class="logo left">
        租号狗网站后台
    </div>
    <div class="icons right">
        <i class="fa fa-bell-o" aria-hidden="true"></i>
    </div>
</div>
<div class="pg-content">
    <div class="menu left">
        <div class="menus" >
            <ul style="list-style: none;">
                <li><a href="houtai.jsp">首页</a></li>
                <li><a href="#">用户管理</a></li>
                <li><a href="#">账号审核</a></li>
                <li><a href="houtaispgl.jsp">订单管理</a></li>
                <li><a href="zhuye.jsp">商城首页</a></li>
            </ul>
        </div>

    </div>
    <div class="content left">
        <%--        //<a href="sjsp.jsp">上架</a><a href="updatesp.jsp">修改</a>--%>
        <div style="background-color: white">
            <div class="biao">
                <table>
                    <tr>
                        <th>游戏种类</th>
                        <th>游戏</th>
                        <th>账号</th>
                        <th>密码</th>
                        <th>区服</th>
                        <th>卖家</th>
                        <th>单价</th>
                        <th>审核</th>
                    </tr>
                    <%
                        searchdao s=new searchdaoimpl();
                        UserInfDao u=new UserInfDao();
                        String sql="select * from product order by Audit";
                        List<product> list1=u.getForList(product.class,sql);
                        for (int i = 0; i < list1.size(); i++) {
                            String pdid=list1.get(i).getPDID();
                            String sql2="select * from productdetails where PDID=?";
                            List<productdetails> list2=u.getForList(productdetails.class,sql2,pdid);
                            for (int j = 0; j < list2.size(); j++) {
                    %>
                    <tr>
                        <td><%=s.searchfname(pdid)%></td>
                        <td><%=s.searchname(pdid)%></td>
                        <td><%=list2.get(j).getAccount()%></td>
                        <td><%=list2.get(j).getPwd()%></td>
                        <td><%=list2.get(j).getZone()%></td>
                        <td><%=s.searchUser(pdid)%></td>
                        <td><%=list2.get(j).getUnitPrice()%></td>
                        <form action="shenhe" method="post" id="shenhe">
                        <%
                            judge ju =new judgeimpl();
                            boolean f=ju.judgeissh(list2.get(j).getProductID());
                            if(!f){
                                Cookie cookie=new Cookie("shenhe",list2.get(j).getProductID());
                                response.addCookie(cookie);
                        %>
                        <td><input type="submit" value="审核" style="border: none;background-color: red"></td>
                        <%
                            }else {
                        %>
                        <td><input type="button" value="已审核"  style="border: none;background-color: #67b168"></td>
                        <%
                            }
                        %>
                        </form>
                    </tr>
                    <%
                                }
                            }
                    %>
                </table>
<%--                <script>--%>
<%--                    function shenhe(sp) {--%>
<%--                        document.cookie="shenhe="+sp;--%>
<%--                        <%searchdao ss=new searchdaoimpl();--%>
<%--         String id=ss.searchshcookie(request);--%>
<%--        System.out.println(id);%>--%>
<%--                        document.getElementById("shenhe").submit();--%>
<%--                    }--%>
<%--                </script>--%>
            </div>
        </div>
    </div>
</div>
<div class="pg-footer"></div>
</body>
</html>

